
spotsweights = {'莫干山':[0.7,0.1],'莫干山风景区':[0.8,0.1],'下渚湖':[0.8,0.1],'新市镇':[0.9,0.1]}
distance = {'下渚湖国家湿地':[0,29,20.8,26,18.7,21.6,24.9,27.6,26.2,29.8,34.3,28.2,31.4],
            '新市古镇':[29,0,45.4,57.2,42.9,45.3,48.8,51.4,50.1,53.6,58.2,52.1,55.2],
            '东明山森林公园':[20.8,45.4,0,43.4,36.9,39.2,42.4,45.1,43.1,47.3,51.4,45.7,48.5],
            '裸心堡':[26,57.2,43.4,0,7,5.8,9.1,11.7,10.4,13.9,10,12.4,2.3],
            '蚕乐谷':[18.7,42.9,36.9,7,0,2.7,6,8.7,7.3,10.9,13.7,9.3,9.3],
            '庾村':[21.6,45.3,39.2,5.8,2.7,0,3.5,6.2,4.8,8.4,12.5,6.8,8],
            '旭光台':[24.9,48.8,42.4,9.1,6,3.5,0,2.7,1.3,1.1,13.7,3.7,11.3],
            '剑池':[27.6,51.4,45.1,11.7,8.7,6.2,2.7,0,1.4,2.8,22,5.4,19.7],
            '芦花荡公园':[26.2,50.1,43.1,10.4,7.3,4.8,1.3,1.4,0,1.5,12.1,4.1,12.7],
            '松月庐':[29.8,53.6,47.3,13.9,10.9,8.4,1.1,2.8,1.5,0,14.3,2.6,16.2],
            '德清后坞村景区':[34.3,58.2,51.4,10,13.7,12.5,13.7,22,12.1,14.3,0,16.1,12.3],
            '莫干山大坑景区':[28.2,52.1,45.7,12.4,9.3,6.8,3.7,5.4,4.1,2.6,16.1,0,14.7],
            '三九坞':[31.4,55.2,48.5,2.3,9.3,8,11.3,19.7,12.7,16.2,12.3,14.7,0]
           }
import numpy as np
from random import choice
# a = np.array(distance['莫干山大坑景区'])
# c = []
# b = np.argwhere(a<10)
# c = np.append(c, b)
# c = list(map(int, c))
# d = np.array(distance['松月庐'])[[c]]
# print(c, d)
import pandas as pd
restaurants = pd.read_csv("./meishi-jsonFile.csv")
li = restaurants['avgPrice'][restaurants['avgPrice']<50].index
print(list(li))


# 方法一:
a = [2, 3, 4, 5]
b = [2, 5, 8]

# [2, 5]
 
# 方法二
print (list(set(a).intersection(set(b))))


'''
    spotvalue1 == 7~13 莫干山风景区 洋家乐
    spotvalue1 == 4~6  莫干山 洋家乐
    spotvalue1 == 3    三合乡13km 19min, 
    spotvalue1 == 2    新市古镇 河滨公园 1.3km
    spotvalue1 == 1    春晖公园11.2km 德清县10.8km 德清县中心城区10km 汇丰广场10.7km 开发区11km 康乐小区11.9km 
                       蓝色港湾9.8km  科技新城11km 18min 群安小区 12.2km 20min 私营城14km 23min 沃尔玛12.6km 19min
                       武康镇10.4km 17min 营盘小区11km 17min 永安小区11.4km 18min 余英坊12km 18min 下渚湖
                       雷甸镇 12.7km 18min
                       乾元镇 6.2km 10min 
                       三合乡 7.9km 11min
                       禹越镇 29.1km 38min
                       河滨公园 28.1km 37min

    '''
    # if spotvalue1 == 2:
    #     restaurantareaName = np.array(restaurants['areaName'])
    #     restaurantindex = np.argwhere([restaurantareaName=='新市古镇' or restaurantareaName=='河滨公园'])
    #     place2value = choice(restaurantindex)[0]
    #     data['place2'] = restaurants['name'][place2value]